//
//  TRoadLoadingHandler.h
//  TRoad2
//
//  Created by ZhangYanhua on 15/9/14.
//  Copyright (c) 2015年 Mach. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "TRoadMoreFooterView.h"
#import "TRoadPullRefreshProtocol.h"

@interface TRoadLoadingHandler : NSObject <UIScrollViewDelegate>

@property (nonatomic, weak) id<TRoadPullRefreshProtocol> refreshDelegate;

@property (nonatomic, strong) UIRefreshControl    *TRDRefreshControl;
@property (nonatomic, strong) TRoadMoreFooterView *loadMoreView;

@property (nonatomic) BOOL enableMore;
@property (nonatomic) BOOL enableRefresh;

@property (nonatomic) BOOL isMoreLoading;
@property (nonatomic) BOOL isLoading;

@property (nonatomic) CGFloat originBottomInset;

+ (TRoadLoadingHandler *)loadingHandlerWithTableView:(UITableView *)tableView
                                 pullRefreshDelegate:(id<TRoadPullRefreshProtocol>)delegate;

- (void)startLoading;
- (void)stopLoading;
- (void)startMoreLoading;
- (void)stopMoreLoading;

- (void)startLoadingProgrammatically;

@end
